package com.memory.wechat.controller.validator.convert;

import com.memory.modules.business.domain.earn.AccountEarn;
import com.memory.modules.business.domain.earn.AccountEarnRecord;
import com.memory.modules.business.domain.earn.CurDayPrice;
import com.memory.wechat.controller.validator.result.BuyRecordVo;
import lombok.*;
import lombok.experimental.Accessors;

import javax.persistence.Access;
import java.io.Serializable;

/**
 * @PackageName: com.memory.wechat.controller.validator.convert
 * @ClassName: BuyRecordVo
 * @Description:
 * @author: zhuguangxun
 * @date 2021/3/28
 */
public class BuyConvert implements Serializable {

    public static BuyRecordVo convert(CurDayPrice record) {
        if (record == null) {
            return null;
        }
        return BuyRecordVo.builder()
                .accountId(record.getAccountId())
                .count(record.getCount())
                .createDate(record.getCreateDate())
                .curPrice(record.getUsdtPrice())
                .cruEarn(record.getCruEarn())
                .build();
    }
}
